<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>用户登录</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
	<script type="text/javascript">
		function doLogin(){
			var name =  $('#loginName').val();
			var password =  $('#loginPassword').val();
			var data ={'name':name,'password':password};
			$.getJSON('loginAction.action',data,function(data){
				if(data.flag){
					$('#topLoginDiv').html("");
					$('#demo').html("当前用户："+data.name+"     "+data.msg);
				}else{
					$('#demo').html(data.msg);
				}
			});
		}
	</script>
  </head>
  <body>
    	<div id="topLoginDiv">
			用户名：<s:textfield name="name"  id="loginName" required="true" size="15"/>
			&nbsp;密码：<s:password name="password" id="loginPassword" required="true" size="15"/>
			<label class="ui-green">
				<input type="button" name="loginButton"  value="登录" onclick="doLogin();" />
			</label>
		</div>
    	<div id="demo" style="display: inline"></div>
  </body>
</html>
